"""-----------------------
" Filename:     QueueItems.py
" Description:  Object definitions for containers for C structs in library
" Group 3:      nachOS
" Author(s):    Jan Durakiewicz
" 
" Class:        CSE 325
" Instructor:   David Duggan
" Assignment:   Lab #1 Queue Manager
" Assigned:     January 22, 2013
" Due:          January 29, 2013
"----------------------"""
import ctypes

class process_control_block(ctypes.Structure):
    _fields_ = [
                 ("pid", ctypes.c_int),
                 ("psw", ctypes.c_int),
                 ("page_table", ctypes.c_int),
                 ("regs", ctypes.POINTER(ctypes.c_int))
               ]

class Queue_item(ctypes.Structure):
    pass
Queue_item._fields_ = [
                        ("id", ctypes.c_int),
                        ("payload", ctypes.c_void_p),
                        ("previous", ctypes.POINTER(Queue_item)),
                        ("next", ctypes.POINTER(Queue_item))
                      ]

class Queue(ctypes.Structure):
    _fields_= [
                ("length", ctypes.c_int),
                ("head", ctypes.POINTER(Queue_item)),
                ("tail", ctypes.POINTER(Queue_item))
              ]
